<?php 
	
	include_once( ABSPATH . 'wp-admin/includes/plugin.php' );

	// Fetch options stored in $data
	global $data;
	
	if(is_plugin_active('woocommerce/woocommerce.php')) {
	      global $woocommerce;
	}

?>

<!DOCTYPE html>
<!--[if lt IE 7]> <html <?php language_attributes(); ?> class="ie6"> <![endif]-->
<!--[if IE 7]>    <html <?php language_attributes(); ?> class="ie7"> <![endif]-->
<!--[if IE 8]>    <html <?php language_attributes(); ?> class="ie8"> <![endif]-->
<!--[if gt IE 8]><!--> <html <?php language_attributes(); ?>> <!--<![endif]-->

<!-- BEGIN head -->
<head>

	<!-- Meta Tags -->
	<meta charset="<?php bloginfo( 'charset' ); ?>" />
	<meta http-equiv="X-UA-Compatible" content="IE=Edge;chrome=1" >
	<meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0">
	
	<?php 
		// Dislay Google Analytics Code
		if( $data['google-analytics'] ) { 
			echo $data['google-analytics'];
		}
		
		// Dislay Favicon
		if( $data['favicon_url'] ) { 			
			echo '<link rel="shortcut icon" href="' . $data['favicon_url'] . '" type="image/x-icon" />';
		}
	?>
	
	<!-- Title -->
	<title><?php wp_title( '|', true, 'right' ); ?></title>
	<meta name="description" content="Cadena l&iacute;der de Peluquer&iacute;as y Spa en el Per&uacute;. M&aacute;s de 150 profesionales de la belleza distribu&iacute;dos en nuestros locales de Miraflores, San Isidro, Surco, La Molina, San Miguel y Asia." />
	<meta name="keywords" content="sal&oacute;n, belleza, novias, tendencias tintes coloraci&oacute;n, corte de pelo, maquillaje, spa"/>
	<meta name="google-site-verification" content="BAEWQkMMkq7wmRlwjGgf_Pl10Qktps9OuhbpICn32rw" />
	
	<!-- Stylesheets -->
	<link rel="stylesheet" href="<?php bloginfo( 'stylesheet_url' ); ?>" type="text/css"  media="all"  />
	
	<?php // Load Google Fonts
		echo google_fonts();
	?>
	
	<!-- RSS Feeds & Pingbacks -->
	<link rel="alternate" type="application/rss+xml" title="<?php bloginfo('name'); ?> RSS Feed" href="<?php bloginfo('rss2_url'); ?>" />
	<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />
	
	<?php // Load Custom CSS 
		echo custom_css(); 
	?>
	
	<?php wp_head(); ?>

        <link href='http://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css'>
        <link href="//netdna.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css" rel="stylesheet">
        <link rel="stylesheet" href="<?php echo get_template_directory_uri(); ?>/custom.css" type="text/css" />
        
        <script type="text/javascript" src="//use.typekit.net/tzh8rbj.js"></script>
        <script type="text/javascript">try{Typekit.load();}catch(e){}</script>
        
        <?php if(is_page('horarios-ubicaciones')){ ?>
            <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
        <?php } ?>
            
        <script type="text/javascript" src="<?php echo get_template_directory_uri(); ?>/js/custom.js"></script>

<!-- END head -->
</head>

<?php 
    if(is_page()){
        $page_slug = "page-".$post->post_name;
    }else {
        $page_slug = '';
    }
?>

<!-- BEGIN body -->
<body <?php body_class($page_slug); ?>>

<div id="fb-root"></div>
<script>(function(d, s, id) {
  var js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) return;
  js = d.createElement(s); js.id = id;
  js.src = "//connect.facebook.net/es_ES/sdk.js#xfbml=1&appId=248825671837586&version=v2.0";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
    
<!-- BEGIN #background-wrapper -->
<div id="background-wrapper">

	<!-- BEGIN .content-wrapper -->
	<div class="content-wrapper clearfix">
	
		<!-- BEGIN #header-wrapper -->
		<div id="header-wrapper" class="clearfix">
		
			<!-- BEGIN #header-left -->
			<div id="header-left">
	
				<?php if( $data['text_logo'] ) : ?>
					<div id="site-title">
						<h2>
							<a href="<?php echo home_url(); ?>"><?php bloginfo( 'name' ) ?></a>
						</h2>
						
					</div>

				<?php elseif( $data['image_logo'] ) : ?>
					<div id="site-title" class="site-title-image">
						<h2>
							<a href="<?php echo home_url(); ?>"><img src="<?php echo $data['image_logo']; ?>" alt="" /></a>
						</h2>
						
					</div>

				<?php else : ?>	
					<div id="site-title">
						<h2>
							<a href="<?php echo home_url(); ?>"><?php _e('Style','qns'); ?><span><?php _e('Mag','qns'); ?></span></a>
						</h2>
						
					</div>
				<?php endif ?>
				
			<!-- END #header-left -->
			</div>
		
			<!-- BEGIN #header-right -->
			<div id="header-right">
	
				<?php if(is_plugin_active('woocommerce/woocommerce.php')) { ?>
					<a class="shopping-bag" href="<?php echo $woocommerce->cart->get_cart_url(); ?>" title="<?php echo sprintf(_n('You have %d item in your shopping bag', 'You have %d items in your shopping bag', $woocommerce->cart->cart_contents_count, 'qns'), $woocommerce->cart->cart_contents_count);?>"><?php echo sprintf(_n('%d', '%d', $woocommerce->cart->cart_contents_count, 'qns'), $woocommerce->cart->cart_contents_count);?></a>
				<?php } ?>
				
				<div class="top-menu-clear"></div>
				
				<?php if ( has_nav_menu( 'secondary' ) ) { ?>

					<!-- Secondary Menu -->
					<?php wp_nav_menu( array(
						'theme_location' => 'secondary',
						'container' =>false,
						'items_wrap' => '<ul class="header-menu clearfix">%3$s</ul>',
						'echo' => true,
						'before' => '',
						'after' => '',
						'link_before' => '',
						'link_after' => '',
						'depth' => 0 )
				 	); ?>

				<?php } ?>
				
				<div class="clearboth"></div>
				
				<?php echo display_social(); ?>
			
			<!-- END #header-right -->
			</div>
		
		<!-- END #header-wrapper -->
		</div>
		
		<!-- BEGIN #main-menu-wrapper -->
		<div id="main-menu-wrapper" class="clearfix">
			
			<div class="mobile-menu-button"></div>
			
			<div class="mobile-menu-wrapper">	
				
				<?php wp_nav_menu( array(
					'theme_location' => 'primary',
					'container' =>false,
					'items_wrap' => '<ul id="mobile-menu">%3$s</ul>',
					'fallback_cb' => 'wp_page_mobile_menu_qns',
					'echo' => true,
					'before' => '',
					'after' => '',
					'link_before' => '',
					'link_after' => '',
					'depth' => 0 )
				); ?>	
				
			</div>
	
			<?php wp_nav_menu( array(
				'theme_location' => 'primary',
				'container' =>false,
				'items_wrap' => '<ul id="main-menu" class="fl clearfix">%3$s</ul>',
				'fallback_cb' => 'wp_page_menu_qns',
				'echo' => true,
				'before' => '',
				'after' => '',
				'link_before' => '',
				'link_after' => '',
				'depth' => 0 )
			); ?>
			
			<?php if( $data['display_menu_search'] ) { ?>
			
				<!--div class="menu-search-button"></div-->
				<form id="main-search-box" method="get" action="<?php echo esc_url( home_url( '/' ) ); ?>" class="menu-search-form-custom">
                                        <!--div class="menu-search-button-custom"></div-->
                                        <input class="menu-search-button-custom" type="submit"></input>
					<input class="menu-search-field-custom" type="text" onblur="if(this.value=='')this.value='<?php _e('To search, type and hit enter','qns'); ?>';" onfocus="if(this.value=='<?php _e('To search, type and hit enter','qns'); ?>')this.value='';" value="<?php _e('To search, type and hit enter','qns'); ?>" name="s" />
					<input type="hidden" value="all" name="post_type"> 
				</form>
			
			<?php } ?>

		<!-- END #main-menu-wrapper -->
		</div>